package com.example.mobile2032021606170hsy0615;

import android.mtp.MtpDevice;
import android.os.Bundle;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {


    private RecyclerView rvMainUsers;
    private List<Users> list = new ArrayList<>();


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        list = new MyDataAdapter().QueryAll(this);
       rvMainUsers.setAdapter(new UsersRViewAdapter(list));

    }

    private void initView() {

        rvMainUsers = (RecyclerView) findViewById(R.id.rvMainUsers);
        rvMainUsers.setLayoutManager(new LinearLayoutManager(this));
    }
}